package com.mproject.network;


import android.app.ProgressDialog;
import android.content.Context;
import android.os.AsyncTask;
import android.util.Log;

public class ProgressBarManager extends AsyncTask<String,String,Boolean>{

	private Context context;
	protected ProgressDialog dialog;
	public ProgressBarManager(Context context)
	{
		this.context=context;
		dialog=new ProgressDialog(context);
	}
	
	/**
	 * @return the context
	 */
	public Context getContext() {
		return context;
	}

	/**
	 * @param context the context to set
	 */
	public void setContext(Context context) {
		this.context = context;
	}

	/**
	 * @return the dialog
	 */
	public ProgressDialog getDialog() {
		return dialog;
	}

	/**
	 * @param dialog the dialog to set
	 */
	public void setDialog(ProgressDialog dialog) {
		this.dialog = dialog;
	}

	protected void onPreExecute() {
        
		Log.v("manager"," in pre execute");
		
        dialog.setMessage("Loading please wait...");
		dialog.setIndeterminate(true);
		
       // dialog.setTitle("Manager");
        dialog.show();
    }
	 
	@Override
	protected Boolean doInBackground(String... params) {
		// TODO Auto-generated method stub
		for(int i=0;i<2800;i++);
		//	Log.v("manager"," "+i);
		return false;
	}
	protected void onPostExecute(Boolean result) {
		Log.v("manager"," in post execute");
		dialog.dismiss();
    }

	

}
